<?php

namespace api\controllers\base;

use yii\web\Response;

class BaseController extends \yii\web\Controller
{
    public function response2Json( $status, $msg, $code = 0, $url2back = '', $data = array() )
    {
           \Yii::$app->response->format = Response::FORMAT_JSON;
           return \Yii::$app->response->data = [
               'status' => $status,
               'msg' => $msg,
               'code' => $code,
               'url2back' => $url2back,
               'data' => $data,
           ];
    }
}
